function TbShareConfig(params){ 
	 
}

TbShareConfig.Where = function(type,proxy){
	this.type = type;
	this.proxy=proxy;
	this.linked = null;
	this.set = null;
	if(this.type==0){
		this.set = new TbShareConfig.Where(1,true);
		this.set.linked = this;
	}
	this.getProxy = function(){
		var m = new TbShareConfig.Where(this.type);//当前的对像
		if(this.type==0){
			m.set = new TbShareConfig.Where(1,true);//set对象
			m.set.linked = m;
		}else{
			m.linked=this.linked;
			this.linked.linked=m;
		}
		return m;
	}
	this.data = {};
	this.put = function(key,value){
		this.data[key] = value;
	}
	this.get = function(key){
		return this.data[key];
	}
	/** 编号 [非空]       **/
	this.tbscId=function(tbscId){if(this.proxy)return this.getProxy().tbscId(tbscId);  this.put("tbscId", tbscId);return this;};
	/** and tbsc_id is null */
	this.tbscIdNull=function(){if(this.proxy)return this.getProxy().tbscIdNull();if(this.get("tbscIdNot")==null)this.put("tbscIdNot", "");this.put("tbscId", null);return this;};
	/** not .... */
	this.tbscIdNot=function(){if(this.proxy)return this.getProxy().tbscIdNot();this.put("tbscIdNot", "not");return this;};
	this.tbscIdNotNull=function(){if(this.proxy)return this.getProxy().tbscIdNotNull();this.put("tbscIdNot", "not");this.put("tbscId", null);return this;};
	this.tbscIdNot=function(tbscId){if(this.proxy)return this.getProxy().tbscIdNot(tbscId);this.put("tbscIdNot", "not");this.put("tbscId", tbscId);return this;};
	/** and tbsc_id <= ? */
	this.tbscIdMin=function(min){if(this.proxy)return this.getProxy().tbscIdMin(min);this.put("tbscIdMin", min);return this;};
	/** and tbsc_id >= ? */
	this.tbscIdMax=function(max){if(this.proxy)return this.getProxy().tbscIdMax(max);this.put("tbscIdMax", max);return this;};
	this.tbscIdIn=function(ids){
		if(this.proxy)return this.getProxy().tbscIdIn(ids);  this.put("tbscIdIn", ids);return this;
	};	
	
	/** 品牌        **/
	this.tbscBrand=function(tbscBrand){if(this.proxy)return this.getProxy().tbscBrand(tbscBrand);  this.put("tbscBrand", tbscBrand);return this;};
	/** and tbsc_brand is null */
	this.tbscBrandNull=function(){if(this.proxy)return this.getProxy().tbscBrandNull();if(this.get("tbscBrandNot")==null)this.put("tbscBrandNot", "");this.put("tbscBrand", null);return this;};
	/** not .... */
	this.tbscBrandNot=function(){if(this.proxy)return this.getProxy().tbscBrandNot();this.put("tbscBrandNot", "not");return this;};
	this.tbscBrandNotNull=function(){if(this.proxy)return this.getProxy().tbscBrandNotNull();this.put("tbscBrandNot", "not");this.put("tbscBrand", null);return this;};
	this.tbscBrandNot=function(tbscBrand){if(this.proxy)return this.getProxy().tbscBrandNot(tbscBrand);this.put("tbscBrandNot", "not");this.put("tbscBrand", tbscBrand);return this;};
	this.tbscBrandIn=function(ids){
		if(this.proxy)return this.getProxy().tbscBrandIn(ids);  this.put("tbscBrandIn", ids);return this;
	};	
	
	/** 分享标题        **/
	this.tbscShareTitle=function(tbscShareTitle){if(this.proxy)return this.getProxy().tbscShareTitle(tbscShareTitle);  this.put("tbscShareTitle", tbscShareTitle);return this;};
	/** and tbsc_share_title is null */
	this.tbscShareTitleNull=function(){if(this.proxy)return this.getProxy().tbscShareTitleNull();if(this.get("tbscShareTitleNot")==null)this.put("tbscShareTitleNot", "");this.put("tbscShareTitle", null);return this;};
	/** not .... */
	this.tbscShareTitleNot=function(){if(this.proxy)return this.getProxy().tbscShareTitleNot();this.put("tbscShareTitleNot", "not");return this;};
	this.tbscShareTitleNotNull=function(){if(this.proxy)return this.getProxy().tbscShareTitleNotNull();this.put("tbscShareTitleNot", "not");this.put("tbscShareTitle", null);return this;};
	this.tbscShareTitleNot=function(tbscShareTitle){if(this.proxy)return this.getProxy().tbscShareTitleNot(tbscShareTitle);this.put("tbscShareTitleNot", "not");this.put("tbscShareTitle", tbscShareTitle);return this;};
	
	/** 分享内容        **/
	this.tbscUrl=function(tbscUrl){if(this.proxy)return this.getProxy().tbscUrl(tbscUrl);  this.put("tbscUrl", tbscUrl);return this;};
	/** and tbsc_url is null */
	this.tbscUrlNull=function(){if(this.proxy)return this.getProxy().tbscUrlNull();if(this.get("tbscUrlNot")==null)this.put("tbscUrlNot", "");this.put("tbscUrl", null);return this;};
	/** not .... */
	this.tbscUrlNot=function(){if(this.proxy)return this.getProxy().tbscUrlNot();this.put("tbscUrlNot", "not");return this;};
	this.tbscUrlNotNull=function(){if(this.proxy)return this.getProxy().tbscUrlNotNull();this.put("tbscUrlNot", "not");this.put("tbscUrl", null);return this;};
	this.tbscUrlNot=function(tbscUrl){if(this.proxy)return this.getProxy().tbscUrlNot(tbscUrl);this.put("tbscUrlNot", "not");this.put("tbscUrl", tbscUrl);return this;};
	
	/** 页面类型    1:产品列表 2:代理卡 3:合伙人 4:有奖邀请 5:优惠券领取     **/
	this.tbscType=function(tbscType){if(this.proxy)return this.getProxy().tbscType(tbscType);  this.put("tbscType", tbscType);return this;};
	/** and tbsc_type is null */
	this.tbscTypeNull=function(){if(this.proxy)return this.getProxy().tbscTypeNull();if(this.get("tbscTypeNot")==null)this.put("tbscTypeNot", "");this.put("tbscType", null);return this;};
	/** not .... */
	this.tbscTypeNot=function(){if(this.proxy)return this.getProxy().tbscTypeNot();this.put("tbscTypeNot", "not");return this;};
	this.tbscTypeNotNull=function(){if(this.proxy)return this.getProxy().tbscTypeNotNull();this.put("tbscTypeNot", "not");this.put("tbscType", null);return this;};
	this.tbscTypeNot=function(tbscType){if(this.proxy)return this.getProxy().tbscTypeNot(tbscType);this.put("tbscTypeNot", "not");this.put("tbscType", tbscType);return this;};
	this.tbscTypeIn=function(ids){
		if(this.proxy)return this.getProxy().tbscTypeIn(ids);  this.put("tbscTypeIn", ids);return this;
	};	
	
	
	
	this.add=function(key,value) {if(proxy)return proxy().add(key,value);this.put(key, value);return this;}
	this.desc=function(sql) {if(proxy)return proxy().desc(sql);this.put("desc", sql);return this;}
	this.asc=function(sql) {if(proxy)return proxy().asc(sql);this.put("asc", sql);return this;}
	this.definex=function(sql) {if(proxy)return proxy().definex(sql);this.put("definex", sql);return this;}
	
	/** 获取所有分享配置 **/
	this.list=function(size){
		this.data.size = size;
		var protocol = ux.ajax("/admin/business/shareconfig.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data && protocol.data.list)return protocol.data.list;
		return [];
	}
	/** 获取分享配置分页 **/
	this.page=function(page,size){
		this.data.size = size;
		this.data.page = page;
		var protocol = ux.ajax("/admin/business/shareconfig.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data)return data;
		return {list:[]};
	}
	/** 根据查询条件取分享配置 **/
	this.get=function(){
		this.data.size = 1;
		var protocol = ux.ajax("/admin/business/shareconfig.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data && protocol.data.list && protocol.data.list.length==1)return protocol.data.list[0]; 
		return null;
	}
}

TbShareConfig.get = function(id){
	var protocol = ux.ajax("/admin/business/shareconfig.get.do",{id:id});
	if(!protocol)return null;
	if(protocol.data)return protocol.data.tbShareConfig;
	return null;
}

TbShareConfig.where = new TbShareConfig.Where(0,true);